﻿using System.ServiceModel;
using ChatForum.DataContract;
using System.Collections.Generic;
using System.ServiceModel.Web;

namespace ChatForum.REST.ServiceContract
{
	[ServiceContract]
	public interface IAccountService
	{
		[OperationContract]
		[FaultContract(typeof(string))]
		[WebGet(UriTemplate = "/users")]
		IEnumerable<UserDTO> GetAllUser();

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebInvoke(Method="POST", UriTemplate = "/users")]
		void CreateUser(UserDTO user);

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebInvoke(Method = "PUT", UriTemplate = "/users")]
		void ModifyAllUser(IEnumerable<UserDTO> userCollection);

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebInvoke(Method = "DELETE", UriTemplate = "/users")]
		void DeleteAllUser();

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebGet(UriTemplate = "/users/{userId}")]
		UserDTO GetUser(string userId);

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebInvoke(Method = "PUT", UriTemplate = "/users/{userId}")]
		void ModifyUser(string userId, UserDTO user);

		[OperationContract]
		[FaultContract(typeof(string))]
		[WebInvoke(Method = "DELETE", UriTemplate = "/users/{userId}")]
		void DeleteUser(string userId);
	}
}
